<?php
class XukeAction extends CommonAction{
	public function Index(){		
		$this->display();
	}
	public function Typelist(){
		echo '[
	{"typeid":"101", "orgName":"食品流通许可证"},
	{"typeid":"102", "orgName":"食品生产许可证"},
	{"typeid":"103", "orgName":"餐饮服务许可证"},
	{"typeid":"104", "orgName":"动物防疫合格证"},
	{"typeid":"105", "orgName":"公共卫生许可证"},
	{"typeid":"106", "orgName":"清真食品经营许可证"},
	{"typeid":"107", "orgName":"生产加工食品小作坊加工许可证"},
	{"typeid":"108", "orgName":"文化经营许可证"},
	{"typeid":"201", "orgName":"其他前置审批手续"},
	{"typeid":"301", "orgName":"生产加工质量承诺书"},
	{"typeid":"302", "orgName":"保健品现场调查核查表"},
	{"typeid":"401", "orgName":"其他证明"},
	{"typeid":"501", "orgName":"流通环节不制售问题乳粉承诺书"},
	{"typeid":"502", "orgName":"不制售假冒伪劣商品责任书"},
	{"typeid":"503", "orgName":"流通环节食品安全自律责任书"}
]';
	}
	public function insert(){
		
	$model = D ('Xuke');
	$model->create();
	if (false === $model->create ()) {
		$this->error ( $model->getError () );
	}
	$model->typeid = $_POST['org1_typeid'];//许可证类型
	$model->minchen = $_POST['org1_orgName'];//许可证名称
	$model->zhaopian = $_POST['attachment_fileName'];//证书照片
	$list=$model->add ();
	//echo D()->getLastSql();	
	if ($list!==false){
	echo '{"statusCode":"200", 
      "message":"添加成功，请继续添加或取消。",
      "callbackType":"closeCurrent",
      "navTabId":""}';	
	}
	else {
		echo '{"statusCode":"300", 
      "message":"添加失败，请检查",
      "callbackType":"closeCurrent",
      "navTabId":""}';	
	}
	}
}
?>